package com.swh.xbsc.controller;

import com.swh.xbsc.entity.Result;
import com.swh.xbsc.entity.User;
import com.swh.xbsc.entity.UserFocus;
import com.swh.xbsc.service.UserFocusService;
import com.swh.xbsc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import java.util.Map;

/**
 * @Author: swh
 * @Description:
 * @Date: 2020/11/17 20:49
 * @Version: 1.0
 */
@RestController
@RequestMapping("/mapper/userFocus")
public class UserFocusController {

    @Autowired
    UserFocusService userFocusService;


    @RequestMapping("selectPage/{pageNum}/{pageSize}")
    public Result selectPage(@PathVariable int pageNum,@PathVariable int pageSize,@RequestParam Map<String,Object>map){
        return new Result(userFocusService.selectPage(pageNum,pageSize,map));
    }

    @RequestMapping("insert")
    public Result insert(@RequestBody UserFocus userFocus) {
        userFocus.setUserFocusId(9);
        userFocus.setUserId(1);
        return new Result(userFocusService.insertSelective(userFocus));
    }

    @RequestMapping(value = "doDetele")
    public Result doDetele(Integer id){
        return new Result(userFocusService.doDelete(id));
    }

}
